package com.john.booter.domain.entity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name = "t_option")
public class Option implements Serializable {

	private static final long serialVersionUID = -3274631361819919047L;
	
	/**
	 * 编码
	 */
	@Id
	@Column(nullable = true)
	private String code;
	/**
	 * 父级编码
	 */
	private String parentCode;
	/**
	 * 操作名称
	 */
	private String name;
	/**
	 * 操作URL 
	 */
	private String url;
	/**
	 * 操作类型
	 */
	private String type;
	/**
	 * 级别
	 */
	private Integer level;
	/**
	 * 排序
	 */
	private Integer sort;
	
	@JsonIgnore
	@ManyToMany(mappedBy="options")
    private Set<Role> roles;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getParentCode() {
		return parentCode;
	}

	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

}
